package com.ruoyi.information.service.back.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.information.mapper.back.SpaceStatisticsBackMapper;
import com.ruoyi.information.domain.back.SpaceStatisticsBack;
import com.ruoyi.information.service.back.ISpaceStatisticsBackService;

/**
 * 空间统计Service业务层处理
 *
 * @author ruoyi
 * @date 2023-05-10
 */
@Service
public class SpaceStatisticsBackServiceImpl implements ISpaceStatisticsBackService
{
    @Autowired
    private SpaceStatisticsBackMapper spaceStatisticsMapper;

    /**
     * 查询空间统计
     *
     * @param id 空间统计主键
     * @return 空间统计
     */
    @Override
    public SpaceStatisticsBack selectSpaceStatisticsById(Long id)
    {
        return spaceStatisticsMapper.selectSpaceStatisticsById(id);
    }

    /**
     * 查询空间统计列表
     *
     * @param spaceStatistics 空间统计
     * @return 空间统计
     */
    @Override
    public List<SpaceStatisticsBack> selectSpaceStatisticsList(SpaceStatisticsBack spaceStatistics)
    {
        return spaceStatisticsMapper.selectSpaceStatisticsList(spaceStatistics);
    }

    /**
     * 新增空间统计
     *
     * @param spaceStatistics 空间统计
     * @return 结果
     */
    @Override
    public int insertSpaceStatistics(SpaceStatisticsBack spaceStatistics)
    {
        spaceStatistics.setCreateTime(DateUtils.getNowDate());
        return spaceStatisticsMapper.insertSpaceStatistics(spaceStatistics);
    }

    /**
     * 修改空间统计
     *
     * @param spaceStatistics 空间统计
     * @return 结果
     */
    @Override
    public int updateSpaceStatistics(SpaceStatisticsBack spaceStatistics)
    {
        spaceStatistics.setUpdateTime(DateUtils.getNowDate());
        return spaceStatisticsMapper.updateSpaceStatistics(spaceStatistics);
    }

    /**
     * 批量删除空间统计
     *
     * @param ids 需要删除的空间统计主键
     * @return 结果
     */
    @Override
    public int deleteSpaceStatisticsByIds(Long[] ids)
    {
        return spaceStatisticsMapper.deleteSpaceStatisticsByIds(ids);
    }

    /**
     * 删除空间统计信息
     *
     * @param id 空间统计主键
     * @return 结果
     */
    @Override
    public int deleteSpaceStatisticsById(Long id)
    {
        return spaceStatisticsMapper.deleteSpaceStatisticsById(id);
    }
}
